package com.qfedu.service.impl;

import com.qfedu.dao.UserDao;
import com.qfedu.dao.impl.UserDaoImpl;
import com.qfedu.model.User;
import com.qfedu.service.UserService;

/**
 * Title: UserServiceImpl
 *
 * @author Wenn.
 * @Package com.qfedu.service.impl
 * @Date 2023/4/18 19:43
 * @Note
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao = new UserDaoImpl();
    @Override
    public int regist(User user) {
        return userDao.regist(user);
    }

    @Override
    public boolean checkUser(String username) {
        User user = userDao.findUser(username);
        if (user!=null){
            return true;
        }
        return false;
    }

    @Override
    public int updateUser(User user) {
        return userDao.updateUser(user);
    }

    @Override
    public User findUserById(int id) {
        return userDao.findUserById(id);
    }


    @Override
    public User login(User user) {
        return userDao.login(user);
    }
}
